package com.miage.itrading.utils;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;


public class ConnecteurBDD {

	private static final String	DATABASE	= Const.DATABASE_URL;
	private static final String	USER		= Const.DATABASE_USERNAME;
	private static final String	PASSWORD	= Const.DATABASE_PASSWORD;

	public static Connection	Conn;

	public static Connection connecte() {
		if (Conn == null) {
			try {
				DriverManager.registerDriver(new com.mysql.jdbc.Driver());
				Conn = DriverManager.getConnection(DATABASE, USER, PASSWORD);
			} catch (SQLException e) {
				e.printStackTrace();
			}
		}
		return Conn;
	}
}